#include "KeyboardAction.h"
#include "QDivaAppController.h"
#include "DIVA_Application.h"
#include "QLogger.h"
#include "DIVA_RenderData.h"
#include "DIVA_Manager.h"

void MoveForward::onKeyPressed(){
	QDivaAppController* controller = DIVA_Application::getInstance()->getController();
	if ( controller->isLeftButtonPressed() ){
		DIVA_Manager::getInstance()->lock();
		controller->dragVM(QDivaAppController::DRAG_FORWARD);
		DIVA_Manager::getInstance()->release();
	} else{
		DIVA_RenderData::getSingletonPtr()->moveFwd(true);
	}
}

void MoveForward::onKeyReleased(){
	DIVA_RenderData::getSingletonPtr()->moveFwd(false);
}
